What is stylelint-config-standard-scss?
The stylelint-config-standard-scss npm package is an extension for Stylelint that provides a standard shareable config for SCSS syntax. It enforces consistent conventions and avoids errors in your stylesheets specifically tailored for SCSS. It is built on top of stylelint-config-standard and adds SCSS specific linting rules from stylelint-scss.
What are stylelint-config-standard-scss's main functionalities?
Linting SCSS Syntax
By extending stylelint-config-standard-scss in your Stylelint configuration file, you can apply a set of predefined rules that are specifically designed for linting SCSS syntax. This helps in maintaining a consistent style and avoiding common mistakes in your SCSS files.
"extends": ["stylelint-config-standard-scss"]
Customization
While stylelint-config-standard-scss provides a comprehensive set of rules out of the box, it also allows for customization. You can override or disable specific rules to tailor the linting process to your project's needs. This example shows how to disable the generic at-rule-no-unknown rule in favor of the SCSS-specific one.
{
"extends": ["stylelint-config-standard-scss"],
"rules": {
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": true
}
}
Other packages similar to stylelint-config-standard-scss
stylelint-config-recommended-scss
This package is similar to stylelint-config-standard-scss but focuses on enforcing recommended SCSS rules without imposing stylistic choices. It's a lighter configuration compared to stylelint-config-standard-scss, making it a good starting point for projects that prefer to define their own stylistic rules.
stylelint-scss
stylelint-scss is a collection of SCSS-specific linting rules for Stylelint. While not a config package itself, it is often used in conjunction with other configurations, including stylelint-config-standard-scss, to provide a comprehensive linting solution for SCSS. It offers more granular control over SCSS linting rules.
stylelint-config-standard-scss
The standard shareable SCSS config for Stylelint.
This config:
To see the rules that this config uses, please read the config itself.
Installation
npm install --save-dev stylelint-config-standard-scss
Usage
Set your stylelint
config to:
{
"extends": "stylelint-config-standard-scss"
}
Extending the config
Simply add a "rules"
key to your config, then add your overrides and additions there.
For example, to turn off the scss/dollar-variable-pattern
rule:
{
"extends": "stylelint-config-standard-scss",
"rules": {
"scss/dollar-variable-pattern": null
}
}